package com.uphone.kingmall.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.china.zhuoyue.R;

/**
 * author : SuMeng
 * e-mail : 986335838@qq.com
 * time   : 2019/02/21
 * desc   : 砍价规则dialog
 */
public class KanJiaGuiZeDialog extends Dialog {

    private final Context context;
    private final String content;

    public KanJiaGuiZeDialog(@NonNull Context context, String content) {
        this(context, 0, content);
    }

    public KanJiaGuiZeDialog(Context context, int themeResId, String content) {
        super(context, themeResId);
        this.context = context;
        this.content = content;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.kingmall_dialog_kanjia_guize);
        setCanceledOnTouchOutside(false);
        ImageView ivClose = findViewById(R.id.iv_close);
        TextView tv_text = findViewById(R.id.tv_text);
        tv_text.setText(content);
        ivClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                cancel();
            }
        });
    }
}
